﻿using System;
using System.Linq;

namespace LINQPad.OpenAccess
{
    /// <summary>
    /// OpenAccessStaticContextDriver - static members.
    /// </summary>
    partial class OpenAccessStaticDataContextDriver
    {
        #region Private

        #region - Functions

        /// <summary>
        /// Gets the attribute from the driver's assembly.
        /// </summary>
        /// <typeparam name="TAttribute">The type of the attribute.</typeparam>
        /// <returns>
        /// The attribute or <c>null</c>.
        /// </returns>
        private static TAttribute GetAttributeFromAssembly<TAttribute>( )
            where TAttribute : Attribute
        {
            return typeof( OpenAccessStaticDataContextDriver ).Assembly
                                                          .GetCustomAttributes( typeof( TAttribute ), false )
                                                          .OfType<TAttribute>( )
                                                          .FirstOrDefault( );
        }

        #endregion

        #endregion
    }
}
